<div class="form-group">
    <label class="col-sm-2 control-label">粉丝</label>
    <div class="col-sm-9 col-xs-12">
        <img src='{$user['avatar']}' style='width:50px;height:50px;padding:1px;border:1px solid #ccc' />

        {if strexists($user['openid'],'sns_wa_')}
            <i class="icon icon-wxapp" data-toggle="tooltip" data-placement="top" data-original-title="小程序注册" style="color: #7586db;"></i>
        {/if}
        {if strexists($user['openid'],'wap_user_')||strexists($user['openid'],'sns_qq_')||strexists($user['openid'],'sns_wx_')}
            <i class="icon icon-mobile2" data-toggle="tooltip" data-placement="top" data-original-title="{if strexists($user['openid'],'wap_user_')}手机号注册{else}APP注册{/if}" style="color: #44abf7;"></i>
        {/if}

        {$user['nickname']}
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label">OPENID</label>
    <div class="col-sm-9 col-xs-12">
        <div class="form-control-static js-clip" data-url='{$user['openid']}'>{$user['openid']}</div>
</div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label">会员等级</label>
    <div class="col-sm-9 col-xs-12">
        {ifp 'user.list.edit'}
        <select name='data[levelid]' class='form-control'>
            <option value=''>{php echo empty($shop['levelname'])?'普通会员':$shop['levelname']}</option>
            {loop $levels $level}
            <option value='{$level['id']}' {if $user['levelid']==$level['id']}selected{/if}>{$level['levelname']}</option>
            {/loop}
        </select>
        {else}
        <div class='form-control-static'>
            {if empty($user['levelid'])}
            {php echo empty($shop['levelname'])?'普通会员':$shop['levelname']}
            {else}
            {php echo pdo_fetchcolumn('select levelname from '.tablename('mx_shop_user_level').' where id=:id limit 1',array(':id'=>$user['levelid']))}
            {/if}
        </div>
        {/if}
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label">会员分组</label>
    <div class="col-sm-9 col-xs-12">
        {ifp 'user.list.edit'}
        <select name='data[groupid]' class='form-control'>
            <option value=''>无分组</option>
            {loop $groups $group}
            <option value='{$group['id']}' {if $user['groupid']==$group['id']}selected{/if}>{$group['groupname']}</option>
            {/loop}
        </select>
        {else}
        <div class='form-control-static'>
            {if empty($user['groupid'])}
            无分组
            {else}
            {php echo pdo_fetchcolumn('select groupname from '.tablename('mx_shop_user_group').' where id=:id limit 1',array(':id'=>$user['groupid']))}
            {/if}
        </div>
        {/if}
    </div>
</div>


<div class="form-group">
    <label class="col-sm-2 control-label">真实姓名</label>
    <div class="col-sm-9 col-xs-12">
        {ifp 'user.list.edit'}
        <input type="text" name="data[realname]" class="form-control" value="{$user['realname']}"  />
        {else}
        <div class='form-control-static'>{$user['realname']}</div>
        {/if}
    </div>
</div>

{if !$openbind}
<div class="form-group">
    <label class="col-sm-2 control-label">手机号</label>
    <div class="col-sm-9 col-xs-12">
        {ifp 'user.list.edit'}
        <input type="text" name="data[mobile]" class="form-control" value="{$user['mobile']}"  />
        {else}
        <div class='form-control-static'>{$user['mobile']}</div>
        {/if}
    </div>
</div>
{/if}


<div class="form-group">
    <label class="col-sm-2 control-label">微信号</label>
    <div class="col-sm-9 col-xs-12">
        {ifp 'user.list.edit'}
        <input type="text" name="data[weixin]" class="form-control" value="{$user['weixin']}" />
        {else}
        <div class='form-control-static'>{$user['weixin']}</div>
        {/if}
    </div>
</div>

<div class="form-group">
    <label class="col-sm-2 control-label">积分上限</label>
    <div class="col-sm-9">
        <div class="form-control-static" style="padding: 0;">
            <label class="radio-inline" style="padding-top: 10px; padding-bottom: 10px;"><input type="radio" class="btn-maxcredit" value="0" {if empty($user['diymaxcredit'])}checked{/if} {ifp 'user.recharge.credit1'} name="data[diymaxcredit]" {else}disabled{/if}>读取系统设置</label>
            <label class="radio-inline" style="padding-top: 10px; padding-bottom: 10px;"><input type="radio" class="btn-maxcredit" value="1" {if !empty($user['diymaxcredit'])}checked{/if} {ifp 'user.recharge.credit1'} name="data[diymaxcredit]" {else}disabled{/if}>自定义</label>
            <input type="number" class="form-control  maxcreditinput" value="{php echo intval($user['maxcredit'])}" style="display: {if empty($user['diymaxcredit'])}none{else}inline-block{/if}; width: 150px;" {ifp 'user.recharge.credit1'} name="data[maxcredit]" {else}disabled{/if}>
        </div>

        {ifp 'user.recharge.credit1'}
        <span class='help-block text-danger'>会员积分上限，0为不限制(后台手动充值不限制，已持有积分不限制，保存后生效)</span>
        {/if}
    </div>
</div>

<div class="form-group">
    <label class="col-sm-2 control-label">平台积分</label>
    <div class="col-sm-3">
        {ifp 'user.recharge.credit1'}
        <div class='input-group'>
            <div class=' input-group-addon'  style='width:200px;text-align: left;'>{$user['credit1']}</div>
            <div class='input-group-btn'>
                <a class='btn btn-primary'  data-toggle='ajaxModal' href="{php echo webUrl('user/list/recharge', array('type'=>'credit1','id'=>$user['id']))}">充值</a>
            </div>
        </div>
        {else}
        <div class='form-control-static'>{$user['credit1']}</div>
        {/if}
    </div>
</div>

<div class="form-group">
    <label class="col-sm-2 control-label">通用积分</label>
    <div class="col-sm-3">
        {ifp 'user.recharge.credit2'}
        <div class='input-group'>
            <div class=' input-group-addon' style='width:200px;text-align: left;'>{$user['credit2']}</div>

            <div class='input-group-btn'><a class='btn btn-primary' data-toggle='ajaxModal' href="{php echo webUrl('user/list/recharge', array('type'=>'credit2','id'=>$user['id']))}">充值</a>
            </div>

        </div>
        {else}
        <div class='form-control-static'>{$user['credit2']}</div>
        {/if}
    </div>
</div>

<div class="form-group">
    <label class="col-sm-2 control-label">注册时间</label>
    <div class="col-sm-9 col-xs-12">
        <div class='form-control-static'>{php echo date("Y-m-d H:i:s",$user['createtime'])}</div>
    </div>
</div>



{if !empty($user['birthyear'])}
<div class="form-group">
    <label class="col-sm-2 control-label">出生日期</label>
    <div class="col-sm-9 col-xs-12">
        <div class='form-control-static'>{$user['birthyear']}-{$user['birthmonth']}-{$user['birthday']}</div>
    </div>
</div>
{/if}

{if !empty($user['idcard'])}
<div class="form-group">
    <label class="col-sm-2 control-label">身份证号</label>
    <div class="col-sm-9 col-xs-12">
        <div class='form-control-static'>{$user['idcard']}</div>
    </div>
</div>
{/if}


<div class="form-group">
    <label class="col-sm-2 control-label">关注状态</label>
    <div class="col-sm-9 col-xs-12">
        <div class='form-control-static'>
            {php $followed = m('user')->followed($user['openid'])}
            {if !$followed}
            {if empty($user['uid'])}
            <label class='label label-default'>未关注</label>
            {else}
            <label class='label label-warning'>取消关注</label>
            {/if}
            {else}
            <label class='label label-success'>已关注</label>
            {/if}

        </div>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label">黑名单</label>
    <div class="col-sm-9 col-xs-12">
        {ifp 'user.list.edit'}
        <label class="radio-inline"><input type="radio" name="data[isblack]" value="1" {if $user['isblack']==1}checked{/if}>是</label>
        <label class="radio-inline" ><input type="radio" name="data[isblack]" value="0" {if $user['isblack']==0}checked{/if}>否</label>
        <span class="help-block">设置黑名单后，此会员无法访问商城</span>
        {else}
        <input type='hidden' name='data[isblack]' value='{$user['isblack']}' />
        <div class='form-control-static'>{if $user['isblack']==1}是{else}否{/if}</div>
        {/if}

    </div>
</div>
{if 0}
<div class="form-group">
    <label class="col-sm-2 control-label">备注</label>
    <div class="col-sm-9 col-xs-12">
        {ifp 'user.list.edit'}
        <textarea name="data[content]" class='form-control'>{$user['content']}</textarea>
        {else}
        <div class='form-control-static'>{$user['content']}</div>
        {/if}
    </div>
</div>
{/if}

{if $openbind}
<div class="form-group-title">用户绑定  </div>
    {if !empty($_W['shopset']['wap']['open'])}
        <div class="alert alert-danger">以下信息修改后会导致用户无法登录WAP端，如需更改请告知该用户！</div>
    {/if}

<div class="form-group">
    <label class="col-sm-2 control-label">手机号码</label>
    <div class="col-sm-9 col-xs-12">
        {ifp 'user.list.edit'}
        <input type="text" class="form-control" value="{$user['mobile']}" {if empty($user['mobile'])}name="data[mobile]"{else} disabled{/if} />
        {else}
        <div class='form-control-static'>{$user['mobile']}</div>
        {/if}
    </div>
</div>

<div class="form-group">
    <label class="col-sm-2 control-label">绑定手机号</label>
    <div class="col-sm-9 col-xs-12">
        {ifp 'user.list.edit'}
            <label class="radio-inline"><input type="radio" value="1" name="data[mobileverify]" {if !empty($user['mobile'])}checked disabled{else}{/if}>已绑定</label>
            <label class="radio-inline" ><input type="radio" value="0" name="data[mobileverify]" {if empty($user['mobile'])}checked{else} disabled {/if}>未绑定</label>
        {else}
        <div class="form-control-static">{if empty($user['mobile'])}未绑定{else}已绑定{/if}</div>
        {/if}
    </div>
</div>


{ifp 'user.list.edit'}
    <div class="form-group">
        <label class="col-sm-2 control-label">用户密码</label>
        <div class="col-sm-9 col-xs-12">
            {ifp 'user.list.edit'}
            <input type="password" name="data[pwd]" class="form-control" value=""  />
            <div class="form-control-static">密码留空则不修改</div>
            {/if}
        </div>
    </div>
{/if}

{/if}

{if 0 && $diyform_flag == 1}
    <div class="form-group-title">自定义表单信息</div>
    {php $datas = iunserializer($user['diyuserdata'])}
    {loop $fields $key $value}
    <div class="form-group">
        <label class="col-sm-2 control-label">{php echo $value['tp_name']}</label>
        <div class="col-sm-9 col-xs-12">
            <div class="form-control-static">
                {template 'diyform/diyform'}
            </div>
        </div>
    </div>
    {/loop}
{/if}

<script type="text/javascript">
    $(function () {
        $(".btn-maxcredit").unbind('click').click(function () {
            var val = $(this).val();
            if(val==1){
                $(".maxcreditinput").css({'display':'inline-block'});
            }else{
                $(".maxcreditinput").css({'display':'none'});
            }
        });
    })
</script>
